﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Data;

namespace AbetEvaluation.Business
{
	public partial class Results : Component
	{
		public Results()
		{
			InitializeComponent();
		}

		public Results(IContainer container)
		{
			container.Add(this);

			InitializeComponent();
		}

		public static DataTable GetResults(Guid takenID)
		{
			Data.DataSet1TableAdapters.abet_ResultsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_ResultsTableAdapter();
			Data.DataSet1.abet_ResultsDataTable table = adapter.GetResults(takenID);
			return table;
		}

		public static int InsertResult(Result r)
		{
			Data.DataSet1TableAdapters.abet_ResultsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_ResultsTableAdapter();
			int result = adapter.InsertResult(r.TakenID, r.QuestionID, r.Answer);
			return result;
		}

		public static int DeleteResultsByTakenID(Guid takenID)
		{
			Data.DataSet1TableAdapters.abet_ResultsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_ResultsTableAdapter();
			int result = adapter.DeleteResultsByTakenID(takenID);
			return result;
		}

		public static int DeleteResultsByQuestionID(Guid questionID)
		{
			Data.DataSet1TableAdapters.abet_ResultsTableAdapter adapter = new Data.DataSet1TableAdapters.abet_ResultsTableAdapter();
			int result = adapter.DeleteResultsByQuestionID(questionID);
			return result;
		}
	}
}
